<template>
    <!-- 附件二：消防控制室值班记录 -->
    <div class="attachment-2-wrap page">
        <div class="page-content page-index">
            <div class="row" style="padding-left:40px;">
                <form class="form-horizontal">
                    <div class="form-group col-xs-12">
                        <div class="text-left">
                            <h3 class="h3" style="letter-spacing: 2px;">附件{{directoryOrder.attachment2}}：</h3>
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <div class="text-left">
                            <h3 class="h3" style="letter-spacing: 2px;">消防控制室值班记录</h3>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="page-break"></div>
        <div class="page-content">
            <div class="row">
                <form class="form-horizontal">
                    <div class="form-group col-xs-8">
                        <label class="col-xs-1 control-label"></label>
                        <label class="col-xs-11 control-label font-bold text-left cid"></label>
                    </div>
                    <div class="form-group col-xs-12">
                        <div class="text-center">
                            <h3 class="h3" style="letter-spacing: 2px;">消防控制室值班记录汇总</h3>
                        </div>
                    </div>
                    <div class="form-group col-xs-12">
                        <div>
                            <div class="pro-info">
                                <div class="col-xs-5 text-left no-padding font-bold">项目名称：{{proname}}</div>
                                <div class="col-xs-2 no-padding text-right font-bold">项目编号：</div>
                                <div class="col-xs-5 no-padding">
                                    <input type="text" placeholder="请输入项目编号" class="form-control no-border no-padding font-bold" v-model="currentPronum">
                                </div>
                            </div>
                            <table id="maintainPlanTable" cellspacing="0" cellpadding="0" border="0">
                                <thead>
                                    <tr class="active">
                                        <th class="text-center" colspan="2">火警数</th>
                                        <th class="text-center" colspan="2">故障报警</th>
                                        <th class="text-center vCenter" rowspan="2">监管报警</th>
                                        <th class="text-center vCenter" rowspan="2">漏报</th>
                                    </tr>
                                    <tr class="active">
                                        <th class="text-center">火警</th>
                                        <th class="text-center">误报</th>
                                        <th class="text-center">故障数</th>
                                        <th class="text-center">修复数</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td class="text-center" width="15%">{{formData.alarmfire}}</td>
                                        <td class="text-center" width="15%">{{formData.alarmfake}}</td>
                                        <td class="text-center" width="18%">{{formData.alarmfault}}</td>
                                        <td class="text-center" width="18%">
                                            <input type="text" class="form-control no-border no-padding text-center" v-model="formData.fixednum">
                                        </td>
                                        <td class="text-center" width="20%">{{formData.regulatoryAlarm}}</td>
                                        <td class="text-center" width="14%">{{formData.unalarm}}</td>
                                    </tr>
                                </tbody>
                                <tfoot>
                                    <tr>
                                        <td colspan="6">火警情况说明:</td>
                                    </tr>
                                    <tr>
                                        <td colspan="6">
                                            <div class="col-xs-12" style="margin: 10px;">
                                                <textarea name="alarmNote" class="no-border print-noborder editable" v-model="formData.alarmnote"></textarea>
                                            </div>
                                        </td>
                                    </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="page-break"></div>
    </div>
</template>
<script>
export default {
    name: 'Attachment-2',
    props: {
        initData: {
            type: Object
        },
        proname: {},
        pronum: {},
        directoryOrder:{
            type:Object,
            default:function(){
                return {}
            }
        }
    },
    data() {
        return {
            currentPronum: this.pronum,
            formData: {
                regulatoryAlarm: '', // 监管报警
                alarmfire: '', // 火警报警数
                alarmnote: '', // 火警情况说明
                alarmfake: '', // 误报数
                alarmfault: '', // 故障报警数
                fixednum: '', // 修复数
                unalarm: '', // 漏报
            }
        }
    },
    created() {
        let that = this
        if(that.initData) {
            that.formData.regulatoryAlarm = that.initData.regulatoryAlarm // 监管报警
            that.formData.alarmfire = that.initData.alarmfire // 火警报警数
            that.formData.alarmnote = that.initData.alarmnote // 火警情况说明
            that.formData.alarmfake = that.initData.alarmfake // 误报数
            that.formData.alarmfault = that.initData.alarmfault // 故障报警数
            that.formData.fixednum = that.initData.fixednum // 修复数
            that.formData.unalarm = that.initData.unalarm // 漏报
        }
    },
    methods: {
        // 获取数据
        getData() {
            let that = this

            return that.formData
        }
    },
    watch: {
        pronum(val, oldVal) {
            if(val != oldVal) {
                this.currentPronum = val
            }
        },
        currentPronum(val, oldVal) {
            if(val != oldVal) {
                this.$emit('changePronum', val)
            }
        }
    }
}
</script>